package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by admin on 2017-07-26.
 */

public class MarkMsgStatusApi extends BaseApi {
    MarkMsgStatusReq req;
    public MarkMsgStatusApi(String member_id,String push_id,String status){
        req=new MarkMsgStatusReq(member_id,push_id,status);
        if("1".equals(status)){
            setShowDialog(false);
        }
    }
    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).markMessageStatus(requestBody);
    }
    private class MarkMsgStatusReq{
        private String push_id;
        private String status;//1-已读 2-删除,""-全部已读
        private String member_id;
        public MarkMsgStatusReq(String member_id,String push_id,String status) {
            super();
            this.member_id=member_id;
            this.push_id=push_id;
            this.status=status;
        }


    }
}
